// 自动生成模板GoodsInfo
package autocode

import (
	"github.com/flipped-aurora/gin-vue-admin/server/global"
	"time"
)

// GoodsInfo 结构体
// 如果含有time.Time 请自行import time包
type GoodsInfo struct {
	global.GVA_MODEL
	NeedNum      *int       `json:"needNum" form:"needNum" gorm:"column:need_num;comment:兑换需要的奶滴/如果是奖品（对应的是 抽中的奶滴数）;size:10;"`
	HaveNum      *int       `json:"haveNum" form:"haveNum" gorm:"column:have_num;comment:已领取数量;size:10;"`
	GoodsName    string     `json:"goodsName" form:"goodsName" gorm:"column:goods_name;comment:奖品名称;size:40;"`
	GoodsType    *int       `json:"goodsType" form:"goodsType" gorm:"column:goods_type;comment:奖品类型（1-兑换奖品；2-抽奖奖品）;size:10;"`
	InventoryNum *int       `json:"inventoryNum" form:"inventoryNum" gorm:"column:inventory_num;comment:库存数量 -1 表示不限制;size:10;"`
	Type         *int       `json:"type" form:"type" gorm:"column:type;comment:奖品类型（1-奶滴；2-优惠劵；3-实物奖励）;size:10;"`
	GoodsUrl     string     `json:"goodsUrl" form:"goodsUrl" gorm:"column:goods_url;comment:图片地址;size:255;"`
	Sour         *int       `json:"sour" form:"sour" gorm:"column:sour;comment:排序;size:10;"`
	IsDelete     *int       `json:"isDelete" form:"isDelete" gorm:"column:is_delete;comment:（0-有效；1-无效）;size:10;"`
	Probability  *int       `json:"probability" form:"probability" gorm:"column:probability;comment:概率;size:10;"`
	Version      *int       `json:"version" form:"version" gorm:"column:version;comment:版本号;size:10;"`
	AppId        string     `json:"appId" form:"appId" gorm:"column:app_id;comment:appid;size:70;"`
	RequestUrl   string     `json:"requestUrl" form:"requestUrl" gorm:"column:request_url;comment:请求地址;size:1024;"`
	Remark       string     `json:"remark" form:"remark" gorm:"column:remark;comment:备注;size:100;"`
	StartTime    *time.Time `json:"startTime" form:"startTime" gorm:"column:start_time;comment:兑换开始时间;"`
}

type GoodsInfoDay struct {
	ID        uint   `gorm:"primarykey"` // 主键ID
	GoodsName string `json:"goodsName" form:"goodsName" gorm:"column:goods_name;comment:奖品名称;size:40;"`
	HaveNum   int    `json:"haveNum" form:"haveNum" gorm:"column:have_num;comment:已领取数量;size:10;"`
	GoodsType *int   `json:"goodsType" form:"goodsType" gorm:"column:goods_type;comment:奖品类型（1-兑换奖品；2-抽奖奖品）;size:10;"`
}

// TableName GoodsInfo 表名
func (GoodsInfo) TableName() string {
	return "goods_info"
}
